package com.ruoyi.app.config.interceptor;


import javax.annotation.Resource;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;


@Configuration
public class InterceptorConfig implements WebMvcConfigurer {

  @Resource
  private AuthenticateInterceptor authenticateInterceptor;

  @Resource
  private ReSubmitInterceptor reSubmitInterceptor;

  @Resource
  private OperationAuthInterceptor operationAuthInterceptor;


  @Override
  public void addInterceptors(InterceptorRegistry registry) {
    registry.addInterceptor(authenticateInterceptor).order(1).addPathPatterns("/**");
    registry.addInterceptor(operationAuthInterceptor).order(2).addPathPatterns("/**");
    registry.addInterceptor(reSubmitInterceptor).order(3).addPathPatterns("/**");
  }

//  @Override
//  public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
//    argumentResolvers.add(new LoginUserHandlerMethodArgumentResolver(userLoginService));
//  }
}
